//queue先进先出，可查看队头和队尾
#include<iostream>
#include<queue>
#include<string>
using namespace std;

class Lei {
    public:
    string m_name;
    int m_age;

    Lei(string name,int age) {
        this->m_name=name;
        this->m_age=age;
    }
};

void test01() {
    queue<Lei> q;
    Lei p1("唐志翔",18);
    Lei p2("赶海",18);
    Lei p3("Kzne",18);
    Lei p4("刘川俞",18);
    q.push(p1);
    q.push(p2);
    q.push(p3);
    q.push(p4);

    cout<<q.size()<<endl;

    while (!q.empty())
    {
        cout<<"队头: "<<q.front().m_name<<" "<<q.back().m_age<<endl;
        cout<<"队尾: "<<q.back().m_name<<" "<<q.back().m_age<<endl;
        q.pop();
    }

    cout<<q.size();
}

int main() {
    test01();
    return 0;
}